<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 每五个求一次平均值 -->
</body>
</html>
<script>
    function pingjunshu() {
    let arr = [];
    let newarr = [];
    let sum = 0;
    let average = 0;
        for (i = 2; i <= 500; i = i + 2) {
            arr[arr.length] = i;
        };
        for (j = 4; j < arr.length; j = j + 5) {
            sum += arr[j] + arr[j - 1] + arr[j - 2] + arr[j - 3] + arr[j - 4]
            average = sum / 5;
            newarr[newarr.length] = average;
            sum=0;
        }
        return newarr;
    }
    console.log(pingjunshu());//[6, 16, 26, 36, 46, 56, 66, 76, 86, 96, 106, 116, 126, 136, 146, 156, 166, 176, 186, 196, 206, 216, 226, 236, 246, 256, 266, 276, 286, 296, 306, 316, 326, 336, 346, 356, 366, 376, 386, 396, 406, 416, 426, 436, 446, 456, 466, 476, 486, 496]
</script>